import { use } from 'react';
import { ConfigProviderContext } from '../contexts/ConfigProviderContext';

export const useConfigProvider = () => {
	const context = use(ConfigProviderContext);
	if (!context) {
		throw new Error('useConfigProvider must be used within a ConfigProvider');
	}
	return context;
};